<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>New Event Creation Page</title>
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="125" style="border: 0px">
                <h:panelGrid columns="3" style="width: 100%">
                    <h:graphicImage value="/images/Simbolo_Meteocal.png" height="100"/>
                    <h1>Event Creation</h1>
                    <h:button outcome="homepage" value="Abort the new event creation" />
                </h:panelGrid>
            </p:layoutUnit> 
            <p:layoutUnit position="center">
                <h:form>
                    <h:panelGrid columns="2" style="width: 100%">
                        <div>
                            Event Name *: 
                            <h:inputText id="nameevent" value="#{eventManager.nome}" required="true"/>
                            Event Description:
                            <h:inputTextarea id="descevent" value="#{eventManager.descr}"/>
                        </div>
                        <div>
                            Event Type *:
                            <h:selectOneRadio id="eventtype" value="#{eventManager.type}" layout="pageDirection" required="true"> 
                                <f:selectItem id="item2" itemLabel="Public Indoor Event" itemValue="1" />
                                <f:selectItem id="item3" itemLabel="Public Outdoor Event" itemValue="2" />
                                <f:selectItem id="item4" itemLabel="Private Indoor Event" itemValue="3" />
                                <f:selectItem id="item5" itemLabel="Private Outdoor Event" itemValue="4" />
                            </h:selectOneRadio>
                        </div>
                        <div>
                            Begin Date *:
                            <p:calendar id="datetime" value="#{eventManager.begDate}" pattern="MM/dd/yyyy HH:mm" required="true"/>
                            End Date *:
                            <p:calendar id="datetime2" value="#{eventManager.endDate}" pattern="MM/dd/yyyy HH:mm" required="true"/>
                        </div>
                        <div>
                            City *: 
                            <h:inputText id="cityevent" value="#{eventManager.city}" required="true"/>
                            Country *:
                            <h:inputText id="countryevent" value="#{eventManager.country}" required="true"/>
                            Address:
                            <h:inputText id="addressevent" value="#{eventManager.address}"/>
                        </div>
                    </h:panelGrid>
                    Participants list: <br/>
                    <h:outputText id="participants" value="#{eventManager.showParticipants}" style="white-space: pre-wrap;"/>
                    <hr/>
                    <br/>
                    <p:inputText type="email" id="emailparticipan" value="#{eventManager.showParticipants}"/>
                    <h:commandButton value="Add a Participant">
                        <f:ajax execute="emailparticipan" render="participants" />
                    </h:commandButton>
                </h:form>
                <br/>
                <p:commandButton value="Save" action="#{eventManager.save()}" />
                <br/>
                The * elements are mandatorial elements.
            </p:layoutUnit>
            <p:layoutUnit position="south" size="60">
                <h:panelGrid columns="3" style="width: 100%">
                    <h:button outcome="contacts" value="Search for a user" />
                    
                    <h:button outcome="notifications" value="Move to your notifications page" />
                    
                    <h:button outcome="index" value="Logout" />
                </h:panelGrid>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>

